import React from "react";
import { message, Popconfirm, Button } from "antd";
interface IProps {
  id: number;
  callback: (id: number) => void;
}
export default class DeleteUser extends React.Component<IProps, any> {
  deleteUser = () => {};
  confirm = () => {
    message.success("This success", 2);
    this.props.callback(this.props.id);
  };
  cancel = () => {
    message.error("This error", 2);
  };
  render() {
    return (
      <div>
        <Button type="default" onClick={this.deleteUser}>
          <Popconfirm
            title="Are you sure to delete this task?"
            onConfirm={this.confirm}
            onCancel={this.cancel}
            okText="Yes"
            cancelText="No"
          >
            删除
          </Popconfirm>
        </Button>
      </div>
    );
  }
}
